﻿using System;
using System.Net.Http;
using System.Net.Http.Headers;

namespace Lhn.Ds.Core.Exceptions
{
    public class ResposeFailException : BusinessException
    {

        public ResposeFailException(ResponseInfo responseInfo,Exception e=null,string message= "服务器返回失败信息") : base(e,message)
        {
            SytechMessage = responseInfo;
        }
    }
    public class ResposeProccessException : BusinessException
    {

        public ResposeProccessException(ResponseInfo responseInfo,System.Exception e=null, string message = "服务器返回错误数据") : base(e,message)
        {
            SytechMessage = responseInfo;
        }

    }
    public class ResponseInfo
    {
        public string ResponseBody { get; set; }
        public HttpHeaders ResponseHeaders { get; set; }

        public override string ToString()
        {
            return $"[ResponseHeaders:{ResponseHeaders},ResponseBody:{ResponseBody},RequestHeader:{RequestHeader},RequestBody:{RequestBody}]";
        }

        public string RequestBody { get; set; }
        public HttpHeaders RequestHeader { get; set; }
    }
}